﻿namespace WeightConverterNamespace
{
    public enum WeightType { kg, pound, ounce, dram, grain };
    public class Weight
    {
        double quantity;
        public WeightType Type
        {
            get; set;
        }
        public double Quantity
        {
            get
            {
                return quantity;
            }
            set
            {
                if (value < 0.0)
                    throw new NegativeAmountException();
                quantity = value;
            }
        }
        public Weight(WeightType type, double amount)
        {
            if (amount < 0.0)
                throw new NegativeAmountException();
            Type = type;
            Quantity = amount;
        } 
    }
}
